import { _get, _post, _delete } from './index';

// 登录
export const login = (data) => {
    const req = {
      data,
      url: '/api/login',
    };
    return _post(req);
}; 

// 注册
export const register = (data) => {
    const req = {
      data,
      url: '/api/register',
    };
    return _post(req);
}

// 获取验证码
export const getCode = (data) => {
  const req = {
    data,
    url: '/api/captcha',
  };
  return _get(req);
}

// 重置密码
export const resetpwd = (data) => {
  const req = {
    data,
    url: '/api/resetpwd',
  };
  return _post(req);
}

export const jobSeekerUpdate = (data) => {
  const req = {
    data,
    url: '/api/jobSeeker/updateInfo',
  };
  return _post(req);
}

export const accountUpdate = (data) => {
  const req = {
    data,
    url: '/api/user/update',
  };
  return _post(req);
}

export const companybasicUpdate = (data) => {
  const req = {
    data,
    url: '/api/company/updateInfo',
  };
  return _post(req);
}

export const getResumeList = (data) => {
  const req = {
    data: {},
    url: `/api/resume/listByUserId/${data}`,
  };
  return _get(req);
}

export const resumeUpdate = (data) => {
  const req = {
    data,
    url: `/api/resume/update`,
  };
  return _post(req);
}

// 新增简历
export const resumeAdd = (data) => {
  const req = {
    data,
    url: `/api/resume/save`,
  };
  return _post(req);
}

// 删除简历
export const deleteResumeInformSure = (data) => {
  const req = {
    data: {},
    url: `/api/resume/delete/${data}`,
  };
  return _get(req);
}

// 设置默认简历
export const resumeSetSetDefault = (data) => {
  const req = {
    data: {},
    url: `/api/resume/setDefault/${data.userId}/${data.resumeId}`,
  };
  return _get(req);
}

// 获取企业参与的招聘会
export const getjobfairappliedlist = (data) => {
  const req = {
    data,
    url: `/api/jobfairapplied/listAll`,
  };
  return _post(req);
}